﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/TemplateAdmin.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="CameraProjects.Admin.ProductsList" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <br />
    <h2>Danh Sách sản phẩm</h2>
    <asp:GridView ID="gvDS" runat="server" AllowPaging="True" class="table" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" OnPageIndexChanging="gvDS_PageIndexChanging" OnRowCancelingEdit="gvDS_RowCancelingEdit" OnRowEditing="gvDS_RowEditing" OnSelectedIndexChanged="gvDS_SelectedIndexChanged" OnSelectedIndexChanging="gvDS_SelectedIndexChanging" OnRowDeleting="gvDS_RowDeleting" >
        <AlternatingRowStyle BackColor="Gainsboro" />
        <Columns>
            
            <asp:TemplateField HeaderText="Mã">
                <EditItemTemplate>
                    <asp:Label ID="id" runat="server" Text='<%# Bind("camId") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="id1" runat="server" Text='<%# Bind("camId") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tên sản phẩm">
                <EditItemTemplate>
                    <asp:Label ID="type_id" runat="server" Text='<%# Bind("camNames") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="type_id1" runat="server" Text='<%# Bind("camNames") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="camSensorType" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="product_code" runat="server" Text='<%# Bind("camSensorType") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="product_code1" runat="server" Text='<%# Bind("camSensorType") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
              <asp:TemplateField HeaderText="Chi tiết" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="product_name" runat="server" Text='<%# Bind("camDetails") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="product_name1" runat="server" Text='<%# Bind("camDetails") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="camMaxResolution" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="color_id" runat="server" Text='<%# Bind("camMaxResolution") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="color_id1" runat="server" Text='<%# Bind("camMaxResolution") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField> 
              <asp:TemplateField HeaderText="Hình Ảnh">
                <EditItemTemplate> 
                    <asp:Image ID="image" runat="server"  ImageUrl='<%# Eval("camImages") %>'/>
                </EditItemTemplate>
                <ItemTemplate>
                  <asp:Image ID="image1" runat="server" Height="100px" Width="100px"  ImageUrl='<%# Eval("camImages") %>'/>
                </ItemTemplate>
            </asp:TemplateField>
           
            <asp:TemplateField HeaderText="Giá">
                <EditItemTemplate>
                    <asp:Label ID="price" runat="server" Text='<%# Bind("camPrice") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="price1" runat="server" Text='<%# Bind("camPrice") %>' Visible="false"></asp:Label>
                   
                     <asp:Label ID="Label1" runat="server" Text='<%#  string.Format(System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN"), "{0:#,## VNĐ}",Eval("camPrice")) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
                <asp:TemplateField HeaderText="camSensorSize" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="description" runat="server" Text='<%# Bind("camSensorSize") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="description1" runat="server" Text='<%# Bind("camSensorSize") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
                <asp:TemplateField HeaderText="camIso" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="quantity" runat="server" Text='<%# Bind("camIso") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="quantity1" runat="server" Text='<%# Bind("camIso") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
                <asp:TemplateField HeaderText="camFocalLengthMulti" Visible="false">
                <EditItemTemplate>
                    <asp:Label ID="date" runat="server" Text='<%# Bind("camFocalLengthMulti") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="date1" runat="server" Text='<%# Bind("camFocalLengthMulti") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tình trạng">
                <EditItemTemplate>
                    <asp:Label ID="isactive" runat="server" Text='<%# Bind("camStatus") %>'></asp:Label>

                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="isactive1" runat="server" Text='<%# Bind("camStatus") %>'></asp:Label>

                     </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField HeaderText="Chi tiết" SelectText="Chi tiết" 
                        ShowSelectButton="True" />
            <asp:CommandField DeleteText="Xóa" HeaderText="Xóa" ShowDeleteButton="True" />
         </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#0000A9" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#000065" />
    </asp:GridView>
    <h2>Chi tiết</h2>
    <table class="auto-style1">
        <tr>
            <td>Mã</td>
            <td>
                <asp:Label ID="lblID" runat="server" Text="Label"></asp:Label>
            </td>
               <td>
                <asp:Button ID="btnReset" CssClass="btn btn-info" runat="server" Text="Reset" OnClick="btnReset_Click"   />
            </td>
        </tr>
          <tr>
            <td>Loại sản phẩm</td>
            <td>
                <asp:DropDownList ID="ddltype_id" CssClass="form-control" runat="server" Width="300px"></asp:DropDownList>
             </td>
        </tr>
        
        <tr>
            <td>Mã code sản phẩm</td>
            <td>
                <asp:TextBox ID="txtproduct_code" CssClass="form-control" runat="server" Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Tên sản phẩm</td>
            <td>
                <asp:TextBox ID="txtproduct_name" CssClass="form-control" runat="server" Width="300px"></asp:TextBox>
            </td>
        </tr>
          <tr>
            <td>Màu</td>
            <td>
                <asp:DropDownList ID="ddlMau" CssClass="form-control" runat="server" Width="300px"></asp:DropDownList>
             </td>
        </tr>
         <tr>
            <td>Kích cỡ</td>
            <td>
                <asp:DropDownList ID="ddlkichco" CssClass="form-control" runat="server" Width="300px"></asp:DropDownList>
             </td>
        </tr>
          <tr>
            <td>Hình ảnh</td>
            <td> 
                <asp:Image ID="imgHinhAnh" runat="server" />
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </td>
        </tr>
        <tr>
            <td>Giá</td>
            <td>
                <asp:TextBox ID="txtprice" CssClass="form-control" runat="server" Width="300px"></asp:TextBox> VNĐ
            </td>
        </tr>
        <tr>
            <td>Chi tiết</td>
            <td>
                    <CKEditor:CKEditorControl ID="txtdes" runat="server"></CKEditor:CKEditorControl>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator4"  ControlToValidate="txtdes" runat="server" ErrorMessage="Nhập Chi tiết" ForeColor="Red"></asp:RequiredFieldValidator>
                                     
                <%--<asp:TextBox ID="txtdes" TextMode="MultiLine" CssClass="form-control" runat="server" Width="300px"></asp:TextBox>--%> 
            </td>
        </tr>
         <tr>
            <td>Số lượng</td>
            <td>
                <asp:TextBox ID="txtqua" CssClass="form-control" runat="server" Width="300px"></asp:TextBox> 
            </td>
        </tr>
         <tr>
            <td>Tình trạng</td>
            <td>
                <asp:DropDownList ID="ddlactive"  CssClass="form-control" runat="server" Width="300px">
                    <asp:ListItem Value="False">Không hoạt động</asp:ListItem>
                    <asp:ListItem Value="True">Hoạt động</asp:ListItem>
                </asp:DropDownList> 
            </td>
        </tr>
        <tr>
              
            <td></td>
            <td>
                <asp:Button ID="btnOK" CssClass="btn btn-info" runat="server" Text="Thêm" OnClick="btnOK_Click" />
                <br /><br /><br /><br />
            </td>
        </tr>
    </table>
</asp:Content>
